/* craco.config.js */
const path = require('path')

const CracoLessPlugin = require('craco-less')
console.log(path.resolve("public"));
module.exports = {
    webpack: {
        // 别名
        alias: {
            "@": path.resolve("src")
        }
    },
    //配置代理解决跨域
    devServer: {
        proxy: {
            "/api": {
                target: "http://www.tp5.com/api", //本地服务地址
                changeOrigin: true,
                pathRewrite: {
                    "^/api": ""
                }
            }
        }
    },
    //配置less
    plugins: [
        {
            plugin: CracoLessPlugin,
            options: {
                lessLoaderOptions: {
                    lessOptions: {
                        javascriptEnabled: true,
                    },
                },
            },
        },
    ],
}
